<?php
/**************************** SERVICE INITIALIZATION BEGINS ****************************/
require_once("../../config.php");
require_once(ML_ROOT."/service-admin.php"); on_models();

$model_list = isset($view_data[Protocol::MODEL_LIST]) ? $view_data[Protocol::MODEL_LIST] : NULL;
/***************************** SERVICE INITIALIZATION ENDS *****************************/
?>

<?php
/********************************* HTML CONTENT BEGINS *********************************/
require_once(ML_INCLUDE."/admin-header.php");
?>
	<h1>Models</h1>
	<form action="<?=url("/admin/models.php")?>" method="post">
	<table>
		<tr>
			<th><input type="checkbox" /></th>
			<th>id</th>
			<th>main_photo</th>
			<th>name</th>
			<th>gender</th>
			<th>height</th>
			<th>weight</th>
			<th>chest</th>
			<th>waist</th>
			<th>hips</th>
			<th>shoes</th>
			<th>locations</th>
			<th>tags</th>
			<th>views</th>
			<th>likes</th>
		</tr>
		<?php if (count($model_list) > 0) : ?>
		<?php foreach($model_list as $model): ?>
		<tr>
			<td><input type="checkbox" name="<?=Protocol::SELECTIONS."[]"?>" value="<?=$model[Protocol::ID]?>" /></td>
			<td><a href="<?=url("/admin/models-edit.php?id=".$model[Protocol::ID])?>"><?=$model[Protocol::ID]?></a></td>
			<td><img src="<?=media($model[Protocol::THUMB_S])?>" /></td>
			<td><?=$model[Protocol::NAME]?></td>
			<td><?=$model[Protocol::GENDER]?></td>
			<td><?=$model[Protocol::HEIGHT]?></td>
			<td><?=$model[Protocol::WEIGHT]?></td>
			<td><?=$model[Protocol::CHEST]?></td>
			<td><?=$model[Protocol::WAIST]?></td>
			<td><?=$model[Protocol::HIPS]?></td>
			<td><?=$model[Protocol::SHOE]?></td>
			<td><?=$model[Protocol::LOCATIONS]?></td>
			<td><?=$model[Protocol::TAGS]?></td>
			<td><?=$model[Protocol::VIEWS]?></td>
			<td><?=$model[Protocol::LIKES]?></td>
		</tr>
		<?php endforeach ?>
		<?php else : ?>
		<tr><td colspan="13">No Models</td></tr>
		<?php endif ?>
		<tr>
			<td colspan="13"><button type="submit">Quit Model</button></td>
		</tr>
	</table>
	</form>
<?php
require_once(ML_INCLUDE."/admin-footer.php");
/********************************** HTML CONTENT ENDS **********************************/
?>